package com.ruoyi.gams.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gams.mapper.GamsBusinessQueueMapper;
import com.ruoyi.gams.domain.GamsBusinessQueue;
import com.ruoyi.gams.service.IGamsBusinessQueueService;

/**
 * 业务队列Service业务层处理
 *
 * @author ruoyi
 * @date 2021-09-03
 */
@Service
public class GamsBusinessQueueServiceImpl implements IGamsBusinessQueueService
{
    @Autowired
    private GamsBusinessQueueMapper gamsBusinessQueueMapper;

    /**
     * 查询业务队列
     *
     * @param id 业务队列主键
     * @return 业务队列
     */
    @Override
    public GamsBusinessQueue selectGamsBusinessQueueById(Integer id)
    {
        return gamsBusinessQueueMapper.selectGamsBusinessQueueById(id);
    }

    /**
     * 查询业务队列列表
     *
     * @param gamsBusinessQueue 业务队列
     * @return 业务队列
     */
    @Override
    public List<GamsBusinessQueue> selectGamsBusinessQueueList(GamsBusinessQueue gamsBusinessQueue)
    {
        return gamsBusinessQueueMapper.selectGamsBusinessQueueList(gamsBusinessQueue);
    }

    /**
     * 新增业务队列
     *
     * @param gamsBusinessQueue 业务队列
     * @return 结果
     */
    @Override
    public int insertGamsBusinessQueue(GamsBusinessQueue gamsBusinessQueue)
    {
        gamsBusinessQueue.setCreateTime(DateUtils.getNowDate());
        return gamsBusinessQueueMapper.insertGamsBusinessQueue(gamsBusinessQueue);
    }

    /**
     * 修改业务队列
     *
     * @param gamsBusinessQueue 业务队列
     * @return 结果
     */
    @Override
    public int updateGamsBusinessQueue(GamsBusinessQueue gamsBusinessQueue)
    {
        return gamsBusinessQueueMapper.updateGamsBusinessQueue(gamsBusinessQueue);
    }

    /**
     * 批量删除业务队列
     *
     * @param ids 需要删除的业务队列主键
     * @return 结果
     */
    @Override
    public int deleteGamsBusinessQueueByIds(Integer[] ids)
    {
        return gamsBusinessQueueMapper.deleteGamsBusinessQueueByIds(ids);
    }

    /**
     * 删除业务队列信息
     *
     * @param id 业务队列主键
     * @return 结果
     */
    @Override
    public int deleteGamsBusinessQueueById(Integer id)
    {
        return gamsBusinessQueueMapper.deleteGamsBusinessQueueById(id);
    }

    @Override
    public List<Map<String, Object>> findQueueListWithCount(Integer deviceId) {
        return gamsBusinessQueueMapper.findQueueListWithCount(deviceId);
    }
}
